package com.qyt.hotel.config;

import lombok.Data;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.util.ResourceUtils;

import java.io.FileNotFoundException;

@Component
@Data
public class GlobalProperties implements Ordered {


    private String uploadBasePath;

    private String adminStaticPath;

    private String roomStaticPath;

    private String roomTypeStaticPath;

    public GlobalProperties() throws FileNotFoundException {

        uploadBasePath = ResourceUtils.getURL("classpath:") + "static/upload/";

        adminStaticPath = uploadBasePath + "admin/";
        roomStaticPath = uploadBasePath + "room/";
        roomTypeStaticPath = uploadBasePath + "roomType/";

    }

    @Override
    public int getOrder() {
        return 0;
    }
}
